The options.cause property attaches an inner Error to the HttpException for server-side observability. It is never serialized into the HTTP response body. In your global filter you can read exception.cause and log the full stack trace while sending only a safe public message to the client.
cause is purely for server-side observability — it is not included in the HTTP response body by default.
Attach the original database, SDK, or third-party error as cause when wrapping it in an HttpException.
Read exception.cause inside your global filter to log the full original stack trace.
This pattern separates what you log (everything) from what you expose to clients (safe messages only).
exception.cause is available as a public property on any HttpException instance.